<template>
	<view class="product-detail pr" :data-theme="theme()" :class="theme() || ''">
		<!-- #ifdef MP-WEIXIN || APP-PLUS -->
		<view class="tc header" :style="topBarHeight() == 0
				? ''
				: 'height:' + topBarHeight() + 'px;padding-top:' + topBarTop() + 'px'
			">
			<view class="reg180" :style="topBarHeight() == 0 ? '' : 'height:' + topBarHeight() + 'px;'">
				<image @click="goback" src="/static/icon/back-jianatou.png" mode="" style="width: 48rpx; height: 48rpx">
				</image>
			</view>
		</view>
		<!-- #endif -->
		<scroll-view :scroll-top="topId" :scroll-with-animation="true" @scroll="scrollFunc" scroll-y="true"
			class="scroll-Y scroll-box" :style="'height:' + scrollviewHigh + 'px'" v-if="!loadding">
			<view class="top-scroll-nav" :style="topBarHeight() == 0 ? '' : 'padding-top:' + topBarTop() + 'px'"
				:class="scrollId < 100 ? 'close' : 'open'">
				<!-- #ifdef MP-WEIXIN || APP-PLUS -->
				<view class="pr d-c-c">
					<view class="reg180" :style="topBarHeight() == 0 ? '' : 'height:' + topBarHeight() + 'px;'
						">
						<image @click="goback" src="/static/icon/back-jianatou.png" mode=""
							style="width: 48rpx; height: 48rpx"></image>
					</view>
					<view class="top-title f30">{{ $t('product.product_details') }}</view>
				</view>
				<!-- #endif -->
				<view class="d-b-c" style="height: 80rpx">
					<view class="flex-1 tc f30 gray3 top-scroll-nav-item"
						:class="{ active: scrollId * 1 + 1 < commentTop }" @click="topId = 0">{{ $t('product.product') }}
					</view>
					<view class="flex-1 tc f30 gray3 top-scroll-nav-item" :class="{
						active:
							scrollId * 1 + 1 < contentTop && scrollId * 1 + 1 > commentTop,
					}" @click="topId = commentTop"> {{ $t('product.reviews') }}

					</view>
					<view class="flex-1 tc f30 gray3 top-scroll-nav-item"
						:class="{ active: scrollId * 1 + 1 > contentTop }" @click="topId = contentTop">
						{{ $t('product.details') }}</view>
				</view>
			</view>
			<!--图片-->
			<!-- <view class="ww100" :style="'height:' + topBarTop() + 'px'"></view> -->
			<view class="product-pic" id="product-pic">
				<swiper class="swiper" indicator-active-color="#ffffff" indicator-color="rgba(255,255,255,.3)"
					:indicator-dots="indicatorDots" :autoplay="autoplay" :interval="interval" :duration="duration"
					@change="changeSwiper">
					<swiper-item v-if="detail.videoLink">
						<view v-if="!isVideoPlay" class="icon iconfont icon-bofang" @click.stop="openVideo('video')">
						</view>
						<image v-if="!isVideoPlay"
							:src="detail.poster ? detail.posterFilePath : detail.image[0].filePath" mode=""
							@click.stop="openVideo('video')"></image>
						<video v-if="isVideoPlay" :src="detail.videoLink" autoplay @click="isVideoPlay = false"
							class="video" :controls="isMPH5" :show-center-play-btn="isMPH5" :show-play-btn="isMPH5"
							:enable-progress-gesture="false"></video>
					</swiper-item>
					<!-- 	<swiper-item v-if="detail.videoId != 0">
						<view v-if="!isVideoPlay" class="icon iconfont icon-bofang" @click="isVideoPlay = true"></view>
						<image v-if="!isVideoPlay" :src="
                detail.posterId > 0
                  ? detail.posterFilePath
                  : detail.image[0].filePath
              " mode="" @click="isVideoPlay = true"></image>
						<video v-if="isVideoPlay" :src="detail.videoFilePath" autoplay @click="isVideoPlay = false"
							class="video" :controls="isMPH5" :show-center-play-btn="isMPH5" :show-play-btn="isMPH5"
							:enable-progress-gesture="false"></video>
					</swiper-item> -->
					<swiper-item v-for="(item, index) in detail.image" :key="index">
						<image :src="item.filePath" mode="aspectFit"></image>
					</swiper-item>
				</swiper>
			</view>
			<!-- 预告商品 -->
			<template v-if="isPreview == 1">
				<previewProduct v-if="!loadding" :detail="detail" @send="sendFunc" :is_fav="is_fav"></previewProduct>
			</template>
			<!--基本信息-->
			<template v-if="ispresale">
				<!--限时秒杀-->
				<view class="limited-spike m-0-20">
					<view class="d-s-c mb16">
						<view class="f32" v-if="activeName == 'advance'"> HK$

							<text class="f42 fb">{{ subPrice(detail[activeName][skuName][0].productPrice, "1") }}.

							</text>
							<text class="f24 fb">{{ subPrice(detail[activeName][skuName][0].productPrice, "2") }}

							</text>
						</view>
						<view class="f32" v-else>
							<text class="f28">{{ $t('product.est_take_price_prefix') }}</text>
							<text class="f48 fb">{{ subPrice(detail.seckill.seckillSku[0].seckillPrice, "1") }}.

							</text>
							<text class="f24 fb">{{ subPrice(detail.seckill.seckillSku[0].seckillPrice, "2") }}

							</text>
							<text class="text-d-line f24 ml10">HK${{ detail.seckill.seckillSku[0].productPrice }}</text>
						</view>
						<!-- <view class="tips-box" v-if="activeName == 'advance'">
							预估到手价HK${{ (detail[activeName][skuName][0].productPrice * 1 - detail[activeName][skuName][0][activePrice] * 1).toFixed(2) }}
						</view> -->
					</view>
					<text class="left-name" v-if="activeName == 'advance'">
						{{ $t('product.deposit_line', { place1: detail[activeName].money, place2: detail[activeName][skuName][0][activePrice] }) }}


					</text>
					<view class="right-time">
						<view class="d-e-c mb16">
							{{ activeText }}
							<image class="jiantou" src="/static/icon/jiantou-white.png" mode=""></image>
						</view>
						<Countdown ref="countdown" :config="{
							startstamp:
								new Date(detail[activeName].startTime).valueOf() / 1000,
							endstamp: new Date(detail[activeName].endTime).valueOf() / 1000,
						}" @returnVal="returnValFunc"></Countdown>
					</view>
				</view>
				<!--基本信息-->
				<view class="bg-white m-0-20 mb20 p20 mt-down-box">
					<view class="d-e-c">
						<view class="flex-1">
							<!-- 优惠券 满减 返积分 -->
							<view class="p-10-0 line-h-50 f22 gray9 text-ellipsis" v-if="discount.givePoints > 0">
								<text class="text-box">{{ $t('product.cashback', { place1: points_name() }) }}</text>
								{{ $t('product.shop_cashback_line', { place1: points_name(), place2: discount.givePoints, place3: points_name() }) }}



							</view>
							<view class="f26 gray3 line-h-50" v-if="discount.productReduce.length > 0">
								<text class="manjian-box" v-for="(item, index) in discount.productReduce" :key="index"
									:label="item" :value="index">
									<template v-if="item.fullType == 1">
										{{ $t('product.full_reduce_line', { place1: item.fullValue, place2: item.reduceValue }) }}

									</template>
									<template v-if="item.fullType == 2">
										{{ $t('product.full_discount_line', {
											place1: item.fullValue, place2: (100 -
												item.reduceValue) / 10})}}


									</template>
								</text>
							</view>
						</view>
						<view class="" v-if="discount.productCoupon.length > 0">
							<div class="text-box-coupon" @click="openCoupon()">
								<text>{{ $t('product.claim_coupon') }}</text>
								<text class="icon iconfont icon-you"></text>
							</div>
						</view>
					</view>
					<view class="f30 gray3 fb">{{ detail.productName }}</view>
					<view class="product-describe" v-if="detail.sellingPoint">{{ detail.sellingPoint }}

					</view>
					<view class="product-presale" v-if="activeName == 'advance'">
						<view class="d-b-s">
							<view class="gray3 f24" style="width: 100rpx">{{ $t('product.final_payment') }}</view>
							<view class="flex-1">
								<view class="f24 redF11"> HK${{ (
									detail[activeName][skuName][0].productPrice * 1 -
									detail[activeName][skuName][0][activePrice] * 1
								).toFixed(2) }}
								</view>
								<view class="gray9 f26">
									({{ detail[activeName].startTime }}-{{ detail[activeName].endTime }})



								</view>
							</view>
						</view>
						<view class="d-b-s">
							<view class="gray3 f24" style="width: 100rpx">{{ $t('product.process') }}</view>
							<view class="flex-1 gray6 f24">{{ $t('product.step_flow_deposit') }}</view>
						</view>
					</view>
				</view>
			</template>
			<!-- 普通商品 -->
			<view class="bg-white p30 mb22 product-info" v-if="!ispresale && isPreview != 1">
				<view class="price-wrap">
					<view class="d-s-s d-c ww100">
						<view class="d-s-c pr ww100 mb16">
							<view class="new-price theme-price">
								<text class="fn mr10 fb" v-if="detail.isUserGrade">{{ $t('product.member_price') }}</text>
								<text>HK$</text>
								<text class="num">{{ detail.productSku.productPrice }}</text>
								<text class="num" v-if="
									detail.spec_type == 20 && detail.productSku.productPrice != detail.productMaxPrice
								"> -{{ detail.productMaxPrice }}

								</text>
								<text class="old-price mr16"
									v-if="detail.productSku.linePrice > 0">HK${{ detail.productSku.linePrice }}</text>
							</view>
							<!--分享-->
							<view class="share-box">
								<button class="d-c d-c-c" @click="showShare">
									<image class="share_img" src="/static/icon/fx.png" mode=""></image>
									<text class="f26">{{ $t('product.share') }}</text>
								</button>
							</view>
							<view class="sc-box">
								<button class="d-c d-c-c" @click="favorite()">
									<image :class="is_fav ? '' : 'img_gray'" class="share_img" src="/static/icon/sc.png"
										mode="">
									</image>
									<text class="f26" :class="isFav ? 'red' : 'gray3'">{{ $t('product.favorite') }}</text>
								</button>
							</view>
						</view>
						<view>
							<text class="already-sale">{{ $t('product.sold', { place1: detail.productSales }) }}</text>
						</view>
					</view>
				</view>
				<view class="d-e-c">
					<view class="flex-1">
						<!-- 优惠券 满减 返积分 -->
						<view class="p-10-0 line-h-50 f22 gray9 text-ellipsis" v-if="discount.givePoints > 0">
							<text class="text-box">{{ $t('product.cashback', { place1: points_name() }) }}</text>
							{{ $t('product.shop_cashback_line', { place1: points_name(), place2: discount.givePoints, place3: points_name() }) }}



						</view>
						<view class="f26 gray3 line-h-50" v-if="discount.productReduce.length > 0">
							<text class="manjian-box" v-for="(item, index) in discount.productReduce" :key="index"
								:label="item" :value="index">
								<template v-if="item.fullType == 1">
									{{ $t('product.full_reduce_line', { place1: item.fullValue, place2: item.reduceValue }) }}

								</template>
								<template v-if="item.fullType == 2">
									{{ $t('product.full_discount_line', {
										place1: item.fullValue, place2: (100 -
											item.reduceValue) / 10})}}

								</template>
							</text>
						</view>
					</view>
					<view class="" v-if="discount.productCoupon.length > 0">
						<div class="text-box-coupon" @click="openCoupon()">
							<text>{{ $t('product.claim_coupon') }}</text>
							<text class="icon iconfont icon-you"></text>
						</div>
					</view>
				</view>

				<view class="product-name text-ellipsis-2">
					<view class="store_type" v-if="detail.supplier.storeType == 20">{{ $t('product.self_operated') }}
					</view>
					{{ detail.productName }}


				</view>
				<view class="product-describe" v-if="detail.sellingPoint">{{ detail.sellingPoint }}

				</view>
			</view>
			<view class="o-h bg-white mb21 p-0-30 product-choice" v-if="detail.specType == 20">
				<!--已选择-->
				<view class="already-choice" @click="isPreview != 1 && openPopup(ispresale ? 'deposit' : 'order')">
					<view class="group-hd">
						<view class="left"><text class="min-name gray3">{{ $t('product.select') }}</text></view>
						<view class="flex-1 p-0-20 center-content f28 text-ellipsis o-h">{{ alreadyChioce }}

						</view>
						<view class="right"><text class="icon iconfont icon-you"
								style="font-size: 22rpx; color: #9a9a9a"></text>
						</view>
					</view>
				</view>
				<view class="already-choice d-s-c" @click="showGuarantee" v-if="detail.server != ''">
					<view class="group-hd">
						<view class="left"><text class="min-name gray9">{{ $t('product.service') }}</text></view>
						<view class="flex-1 p-0-20 center-content f28 text-ellipsis o-h">{{ serverList }}</view>
					</view>
					<view class="right"><text class="icon iconfont icon-jiantou ml10"
							style="font-size: 22rpx;color: #333;"></text>
					</view>
				</view>
			</view>

			<!--评价-->
			<view class="product-comment" id="product-comment">
				<view class="p-0-30 d-b-c">
					<view class="group-hd">
						<text class="min-name f28">{{ $t('product.reviews') }}</text>
						<text class="f22 gray9">（{{ commentDataCount > 99 ? "99+" : commentDataCount || 0 }}）

						</text>
					</view>
					<view class="right" @click="lookEvaluate(detail.productId)">
						<text class="f24 gray9">{{ $t('product.view_all') }}</text>
						<text class="icon iconfont icon-you ml20" style="font-size: 24rpx; color: #999"></text>
					</view>
				</view>
				<view class="comment-list" v-if="commentDataCount > 0">
					<view class="item" v-for="(item, index) in commentData" :key="index">
						<view class="cmt-user">
							<view class="left">
								<image class="photo" :src="item.avatarUrl ? item.avatarUrl : ''" mode="aspectFill">
								</image>
								<text class="name">{{ item.nickName ? item.nickName : $t("product.unknown_user") }}

								</text>
							</view>
							<text class="datetime">{{ item.createTime }}</text>
						</view>
						<view class="mt20 lh150 f24">{{ item.content }}</view>
					</view>
				</view>
			</view>
			<!-- 店铺信息 -->
			<view class="shop_head_info product-comment" v-if="store_open">
				<view class="shop-box">
					<view class="shop-logo">
						<image :src="shop_info.logoFilePath" mode=""></image>
					</view>
					<view class="shop-box-info flex-1">
						<view class="f32 title fb">{{ shop_info.name }}</view>
						<view class="f26 brand gray9">{{ $t('product.main_brand_label', { place1: shop_info.categoryName }) }}
						</view>
						<view class="f26 sales gray9">{{ $t('product.sales_qty_label', { place1: shop_info.productSales }) }}
						</view>
					</view>
					<view class="shop-infobox">
						<view class="f26 dominant"> {{ $t('product.merchant_rating') }}

							<text class="fb">{{ shop_info.serverScore }}</text>
						</view>
						<button class="theme-borderbtn" @click="goto_shop()"> {{ $t('product.enter_store') }}

						</button>
					</view>
				</view>
			</view>
			<!--详情内容-->
			<view class="product-content" id="product-content">
				<view class="p-0-30 border-b-e">
					<view class="group-hd d-s-c"><text class="min-name f28">{{ $t('product.product_description') }}</text>
					</view>
				</view>
				<view class="content-box">
					<view class="contentVideo" v-if="detail.contentVideoId != 0">
						<view v-if="!isContentVideoPlay" class="icon iconfont icon-bofang"
							@click.stop="openVideo('content-video')">
						</view>
						<image v-if="!isContentVideoPlay" :src="detail.contentPoster ? detail.contentPoster : ''"
							mode="" @click.stop="openVideo('content-video')"></image>
						<video v-if="isContentVideoPlay" :src="detail.contentVideo" autoplay
							@click="isContentVideoPlay = false" class="video" :controls="isMPH5"
							:show-center-play-btn="isMPH5" :show-play-btn="isMPH5"
							:enable-progress-gesture="false"></video>
					</view>
					<view v-if="detail.isPicture == 0" class="" v-html="detail.content"></view>
					<view v-if="detail.isPicture == 1" class="">
						<view class="ww100" v-for="(item, index) in detail.contentImage" :key="index">
							<image class="ww100" :src="item.filePath" mode="widthFix"></image>
						</view>
					</view>
				</view>
			</view>
			<view class="sage-bottom"></view>
		</scroll-view>

		<!--底部按钮-->
		<view class="btns-wrap">
			<view class="icon-box d-c-c" @click="gotoPage('/pages/index/index')">
				<button class="d-c-c d-c bg-white">
					<text class="btn_btom pr icon iconfont icon-shouye gray9"
						style="font-size: 36rpx; height: 50rpx; line-height: 60rpx"></text>
					<text class="f22 gray9" style="height: 50rpx; line-height: 40rpx">{{ $t('product.home') }}</text>
				</button>
			</view>
			<!-- #ifndef MP -->
				<view class="icon-box d-c-c" @click="openMaservice">
					<button class="d-c-c d-c bg-white">
						<text class="icon iconfont icon-kefu gray9"
							style="font-size: 36rpx; height: 50rpx; line-height: 60rpx"></text>
						<text class="f22 gray9"
							style="height: 50rpx; line-height: 40rpx">{{ $t('product.customer_service') }}</text>
					</button>
				</view>
			<!-- #endif -->
			<!-- #ifdef MP -->
				<view class="icon-box d-c-c">
					<button class="d-c-c d-c bg-white"   open-type="contact" session-from="wxapp">
						<text class="icon iconfont icon-kefu gray9"
							style="font-size: 36rpx; height: 50rpx; line-height: 60rpx"></text>
						<text class="f22 gray9"
							style="height: 50rpx; line-height: 40rpx">{{ $t('product.customer_service') }}</text>
					</button>
				</view>
			<!-- #endif -->
			
			<view class="icon-box d-c-c" @click="gotocart">
				<button class="pr d-c-c d-c bg-white">
					<text class="gray9 icon iconfont icon-gouwuche1"
						style="font-size: 36rpx; height: 50rpx; line-height: 60rpx"></text>
					<text class="f22 gray9"
						style="height: 50rpx; line-height: 40rpx">{{ $t('product.shopping_cart') }}</text>
					<text v-if="cart_total_num > 0" class="cart_num">{{ cart_total_num }}

					</text>
				</button>
			</view>
			<template v-if="isPreview == 1">
				<button class="add-cart-no" style="border-radius: 40rpx; margin-right: 20rpx">
					{{ $t('product.not_on_sale') }}

				</button>
			</template>
			<template v-else>
				<button v-if="
					!roomId == true && !isVirtual && !ispresale && !detail.customForm
				" class="add-cart" @click="openPopup('card')"> {{ $t('product.add_to_cart') }}

				</button>
				<button v-else class="add-cart-no">{{ $t('product.add_to_cart') }}</button>
				<button class="buy" v-if="!ispresale" @click="openPopup('order')"> {{ $t('product.buy_now') }}

				</button>
				<button class="buy ispresale" v-else @click="openPopup('deposit')">
					<template v-if="activeName == 'advance'">
						<view class="f28">{{ $t('product.pay_deposit0') }}</view>
						<view class="f22">HK${{ detail[activeName].money }}</view>
					</template>
					<template v-else> {{ $t('product.buy_now') }} </template>
				</button>
			</template>
		</view>

		<!--购物确定-->
		<spec :isPopup="isPopup" :productModel="productModel" @close="closePopup" :roomId="roomId"></spec>
		<!--底部弹窗-->
		<share :isbottmpanel="isbottmpanel" :productId="productId" @close="closeBottmpanel"></share>
		<!--app分享-->
		<AppShare :isAppShare="isAppShare" :appParams="appParams" @close="closeAppShare"></AppShare>
		<!--生成图片-->
		<uniPopup :show="isCreatedImg" type="middle" @hidePopup="hidePopupFunc">
			<view class="d-c-c d-c create-img">
				<image :src="poster_img" mode="widthFix"></image>
				<!-- #ifdef MP -->
				<button class="btn-red mt20" type="default" @click="savePosterImg"> {{ $t('product.save_image') }}

				</button>
				<!-- #endif  -->
				<!-- #ifdef H5 -->
				<view class="mt20 f34 red" type="default">{{ $t('product.long_press_to_save') }}</view>
				<!-- #endif -->
			</view>
		</uniPopup>
		<!--客服-->
		<Mpservice v-if="isMpservice" :shopSupplierId="detail.shopSupplierId" :isMpservice="isMpservice"
			@close="closeMpservice"></Mpservice>
		<!-- 保障弹窗 -->
		<guarantee :isguarantee="isguarantee" :server="detail.server" @close="closeGuarantee"></guarantee>
		<!--优惠券-->
		<coupon :isCoupon="isCoupon" :discount="discount" :couponList="discount.productCoupon" @close="closeCouponFunc">
		</coupon>
	</view>
</template>

<script>
import coupon from "./popup/coupon.vue";
import share from "./popup/share.vue";
import guarantee from '@/components/guarantee.vue';
import spec from "./popup/spec.vue";
import uniPopup from "@/components/uni-popup.vue";
import Mpservice from "@/components/mpservice/Mpservice.vue";
import AppShare from "@/components/app-share.vue";
import utils from "@/common/utils.js";
import Countdown from "@/components/countdown/countdown-presale.vue";
import previewProduct from "./productinfo/previewProduct.vue";
export default {
	components: {
		spec,
		share,
		uniPopup,
		Mpservice,
		AppShare,
		coupon,
		Countdown,
		previewProduct,
		guarantee
	},
	data() {
		return {
			ispresale: false,
			statusBarHeight: 0,
			titleBarHeight: 0,
			store_open: 1,
			shop_info: {},
			//店铺信息
			isguarantee: false,
			/*手机高度*/
			phoneHeight: 0,
			/*可滚动视图区域高度*/
			scrollviewHigh: 0,
			/*是否加载完成*/
			loadding: true,
			/*是否显示面板指示点*/
			indicatorDots: true,
			roomId: "",
			/*是否知道切换*/
			autoplay: false,
			/*自动切换时间间隔*/
			interval: 2000,
			/*滑动动画时长*/
			duration: 500,
			/*是否确定购买弹窗*/
			isPopup: false,
			/*商品id*/
			productId: null,
			serverList: '',
			//保障
			/*商品详情*/
			detail: {
				productSku: {},
				showSku: {
					productPrice: "",
					productSkuId: 0,
					linePrice: "",
					stockNum: 0,
					skuImage: ""
				}
			},
			/*商品属性*/
			specData: null,
			/*子级页面传参*/
			productModel: {},
			buyNow: false,
			url: "",
			/*规格数组*/
			productSpecArr: [],
			/*购物车商品数量*/
			cart_total_num: 0,
			/*分享*/
			isbottmpanel: false,
			/*是否生成图片*/
			isCreatedImg: false,
			poster_img: "",
			/*是否打开客服*/
			isMpservice: false,
			/*已经选择的规格*/
			alreadyChioce: "",
			/*app分享*/
			isAppShare: false,
			appParams: {
				title: "",
				summary: "",
				path: ""
			},
			is_virtual: 1,
			isVideoPlay: false,
			isFav: false,
			isCoupon: false,
			couponList: [],
			show_discount: "",
			discount: {
				productCoupon: [],
				productReduce: [],
				givePoints: ""
			},
			/*倒计时配置*/
			countdownConfig: {
				/*开始时间*/
				startstamp: 0,
				/*结束时间*/
				endstamp: 0
			},
			// 评论
			commentDataCount: 0,
			commentData: [],
			/* 活动字段 */
			activeName: "",
			activePrice: "",
			activeText: "",
			skuName: "",
			isPreview: false,
			sTop: 0,
			topId: "",
			scrollId: "",
			commentTop: 0,
			contentTop: 0,
			serviceUser: null,
			serviceType: null,
			isMPH5: false,
			isContentVideoPlay: false
		};
	},
	onReady() {
		uni.setNavigationBarColor({
			frontColor: "#000000",
			backgroundColor: "#F5F5F5"
		});
	},
	onLoad(e) {
		/*商品id*/
		let scene = utils.getSceneData(e);
		this.roomId = e.roomId;
		console.log("roomid2", e.roomId);
		this.productId = e.productId ? e.productId : scene.gid;
		// 公众号分享
		if (this.getPlatform() == "mp") {
			this.url = window.location.href;
		}
		//#ifdef H5
		if (this.isWeixin()) {
			this.url = window.location.href;
			this.isMPH5 = true;
		}
		//#endif
	},
	onShow() {
		uni.setNavigationBarTitle({
			title: this.$t('product.product_details')
		})
	},
	mounted() {
		this.init();
		/*获取产品详情*/
		this.getData();
	},
	/*分享*/
	onShareAppMessage() {
		let self = this;
		self.taskFunc();
		// 构建页面参数
		let params = self.getShareUrlParams({
			productId: self.productId
		});
		return {
			title: self.detail.productName,
			path: "/pages/product/detail/detail?" + params
		};
	},
	methods: {
		closeGuarantee() {
			this.isguarantee = false;
		},
		showGuarantee() {
			this.isguarantee = true;
		},
		getServer() {
			let self = this;
			let serverList = [];
			if (self.detail && self.detail.server) {
				self.detail.server.forEach((item, index) => {
					serverList.push(item.name);
				});
			}
			self.serverList = serverList.join('·');
		},
		openVideo(name) {
			if (name == "video") {
				this.isVideoPlay = true;
				this.isContentVideoPlay = false;
			} else {
				this.isVideoPlay = false;
				this.isContentVideoPlay = true;
			}
		},
		scrollFunc(e) {
			let self = this;
			self.scrollId = e.detail.scrollTop.toFixed(1);
			console.log(self.scrollId);
		},
		/*初始化*/
		init() {
			let _this = this;
			uni.getSystemInfo({
				success(res) {
					_this.phoneHeight = res.windowHeight;
					// 计算组件的高度
					let view = uni.createSelectorQuery().select(".btns-wrap");
					view.boundingClientRect(data => {
						let h = _this.phoneHeight - data.height;
						_this.scrollviewHigh = h;
					}).exec();
				}
			});
		},
		initScroll() {
			let self = this;
			let topBarHeight = self.topBarHeight();
			let hight = 0;
			if (topBarHeight) {
				hight = self.topBarHeight() + self.topBarTop() + 50;
			} else {
				hight = 50;
			}
			uni.getSystemInfo({
				success(res) {
					// 计算组件的高度
					let comment = uni.createSelectorQuery().select("#product-comment");
					comment.boundingClientRect(data => {
						console.log(data);
						self.commentTop = data.top - hight;
					}).exec();
					let content = uni.createSelectorQuery().select("#product-content");
					content.boundingClientRect(data => {
						self.contentTop = data.top - hight;
					}).exec();
				}
			});
		},
		/*获取数据*/
		getData() {
			let self = this;
			uni.showLoading({
				title: this.$t("product.loading")
			});
			self._get("product/product/detail", {
				productId: self.productId,
				url: self.url
			}, function (res) {
				console.log(1);
				if (res.data.detail.isPreview == 1 && new Date().valueOf() / 1000 < res.data.detail.previewTimeStamp) {
					/* 是否在预告中 */
					self.isPreview = res.data.detail.isPreview;
					self.activeText = self.$t("product.preview");
					self.activeName = "preview";
					self.activePrice = "preview_price";
					res.data.detail.preview = {
						startTime: new Date().valueOf() / 1000,
						endTime: res.data.detail.previewTimeStamp
					};
				} else if (res.data.detail.seckill && res.data.detail.seckill != null) {
					self.ispresale = true;
					self.activeName = "seckill";
					self.activeText = self.$t("product.flash_sale");
					self.activePrice = "secKillPrice";
					self.skuName = "secKillSku";
					res.data.detail.seckill.startTime = res.data.detail.seckill.active.startTime;
					res.data.detail.seckill.endTime = res.data.detail.seckill.active.endTime;
				} else if (res.data.detail.advance && res.data.detail.advance != null) {
					self.ispresale = true;
					self.activeName = "advance";
					self.activeText = self.$t("product.presale");
					self.activePrice = "advancePrice";
					self.skuName = "sku";
				}
				console.log("321", self.sKuName);
				console.log("123", self.ispresale);
				self.cart_total_num = res.data.cartTotalNum;

				/*详情内容格式化*/
				res.data.detail.content = utils.format_content(res.data.detail.content);

				// 初始化商品多规格
				if (res.data.detail.specType == 20) {
					self.initSpecData(res.data.specData);
				}
				self.detail = res.data.detail;
				self.isVirtual = res.data.detail.isVirtual;
				self.isFav = res.data.isFav;
				self.commentDataCount = res.data.commentDataCount;
				self.commentData = res.data.commentData;
				self.show_discount = res.data.show_discount;
				self.discount = res.data.discount;
				self.serviceUser = res.data.serviceUser;
				self.serviceType = res.data.serviceType;
				self.shop_info = res.data.detail.supplier;
				self.getServer();
				//#ifdef MP-WEIXIN
				self.store_open = res.data.storeOpen;
				//#endif
				console.log("list", self.discount.productCoupon);
				console.log("deatil", self.detail.seckill);
				// 配置微信分享参数
				if (self.getPlatform() == "mp") {
					let params = {
						productId: self.productId
					};
					self.configWx(res.data.share.signPackage, res.data.share.shareParams, params);
				}
				self.loadding = false;
				uni.hideLoading();
				self.$nextTick(() => {
					self.initScroll();
				});
			});
		},
		//跳转店铺首页
		goto_shop() {
			let self = this;
			self.gotoPage("/pages/shop/shop?shopSupplierId=" + self.detail.shopSupplierId);
		},
		/*多规格商品*/
		initSpecData(data) {
			for (let i in data.specAttr) {
				for (let j in data.specAttr[i].specItems) {
					data.specAttr[i].specItems[j].checked = false;
				}
			}
			this.specData = data;
			if (this.specData.specAttr) {
				this.specData.specAttr.forEach(item => {
					this.alreadyChioce += item.groupName;
					this.alreadyChioce += " / ";
				});
				this.alreadyChioce = this.alreadyChioce.replace(/(\s\/\s)$/gi, "");
			}
		},
		/*选规格*/
		openPopup(e) {
			let obj = {
				specData: this.specData,
				detail: this.detail,
				productSpecArr: this.specData != null ? new Array(this.specData.specAttr.length) : [],
				showSku: {
					skuImage: "",
					price: 0,
					productSkuId: 0,
					linePrice: 0,
					stock: 0,
					sum: 1
				},
				plusSku: null,
				type: e,
				plusName: ""
			};
			if (this.activeName == "advance") {
				obj.plusSku = this.detail.advance.sku;
				obj.plusName = "advance";
			}
			if (this.activeName == "seckill") {
				obj.plusSku = this.detail.seckill.seckillSku;
				obj.plusName = "seckill";
			}
			this.productModel = obj;
			console.log(this.productModel, "productModel");
			this.isPopup = true;
		},
		/*关闭弹窗*/
		closePopup(e, cart_total_num) {
			this.isPopup = false;
			console.log("e", e);
			if (e && e.specAttr) {
				this.alreadyChioce = "";
				let has = this.$t("product.selected1");
				let noone = "";
				e.specAttr.forEach(item => {
					if (item.specItems) {
						let h = "";
						for (let i = 0; i < item.specItems.length; i++) {
							let child = item.specItems[i];
							if (child.checked) {
								h = child.specValue + " / ";
								break;
							}
						}
						if (h != "") {
							has += h;
						} else {
							noone += item.groupName;
						}
					}
				});
				if (noone != "") {
					this.alreadyChioce = noone;
				} else {
					has = has.replace(/(\s\/\s)$/gi, "");
					this.alreadyChioce = has;
				}
			}
			if (cart_total_num) {
				this.cart_total_num = cart_total_num;
			}
		},
		openCoupon() {
			this.isCoupon = !this.isCoupon;
			console.log(this.isCoupon);
		},
		/*关闭优惠券*/
		closeCouponFunc(e) {
			this.isCoupon = false;
		},
		/*查看更多评价*/
		lookEvaluate(productId) {
			this.gotoPage("/pages/product/detail/look-evaluate/look-evaluate?productId=" + productId);
		},
		/*分享*/
		onShareAppMessage() {
			let self = this;
			// 构建页面参数
			let params = self.getShareUrlParams({
				productId: self.productId
			});
			return {
				title: self.detail.productName,
				path: "/pages/product/detail/detail?" + params
			};
		},
		/*跳转购物车*/
		gotocart() {
			uni.switchTab({
				url: "/pages/cart/cart"
			});
		},
		//关闭分享
		closeBottmpanel(data) {
			this.isbottmpanel = false;
			if (data.type == 2) {
				this.poster_img = data.poster_img;
				this.isCreatedImg = true;
			}
		},
		//关闭分享
		closeAppShare(data) {
			this.isAppShare = false;
		},
		//分享按钮
		showShare() {
			let self = this;
			//#ifndef APP-PLUS
			self.isbottmpanel = true;
			//#endif
			//#ifdef APP-PLUS
			self.appParams.title = self.detail.productName;
			self.appParams.summary = self.detail.productName;
			// 构建页面参数
			let params = self.getShareUrlParams({
				productId: self.productId
			});
			self.appParams.path = "/pages/product/detail/detail?" + params;
			self.appParams.image = self.detail.image[0].filePath;
			self.isAppShare = true;
			//#endif
			self.taskFunc();
		},
		taskFunc() {
			let self = this;
			self._post("plus/task/task/dayTask", {
				taskType: "product"
			}, res => {
				console.log("分享成功");
			});
		},
		//关闭生成图片
		hidePopupFunc() {
			this.isCreatedImg = false;
		},
		//保存海报图片
		savePosterImg() {
			let self = this;
			uni.showLoading({
				title: this.$t("product.loading")
			});
			// 下载海报图片
			uni.downloadFile({
				url: self.poster_img,
				success(res) {
					uni.hideLoading();
					// 图片保存到本地
					uni.saveImageToPhotosAlbum({
						filePath: res.tempFilePath,
						success(data) {
							uni.showToast({
								title: self.$t("product.save_success"),
								icon: "success",
								duration: 2000
							});
							// 关闭商品海报
							self.isCreatedImg = false;
						},
						fail(err) {
							if (err.errMsg === "saveImageToPhotosAlbum:fail auth deny") {
								uni.showToast({
									title: self.$t("product.please_allow_access_photos"),
									icon: "none",
									duration: 1000
								});
								setTimeout(() => {
									uni.openSetting();
								}, 1000);
							}
						},
						complete(res) {
							console.log("complete");
						}
					});
				}
			});
		},
		goback() {
			let routes = getCurrentPages(); // 获取当前打开过的页面路由数组
			console.log("ly", routes.length);
			if (routes.length <= 1) {
				this.gotoPage("/pages/index/index");
			} else {
				uni.navigateBack();
			}
		},
		/*打开客服*/
		openMaservice() {
			if (!this.getUserId()) {
				this.doLogin();
				return;
			}
			if (this.serviceType == 10 || this.detail.userId == uni.getStorageInfoSync("userId")) {
				this.isMpservice = true;
			} else if (this.serviceType == 20) {
				if (this.serviceUser && this.serviceUser.serviceUserId == 0) {
					uni.showToast({
						title: this.$t("product.no_customer_service_set"),
						icon: "none",
						//如果要纯文本，不要icon，将值设为'none'
						duration: 2000 //持续时间为 2秒
					});
				} else {
					this.gotoPage("/pages/plus/chat/chat?userId=" + this.serviceUser.serviceUserId + "&productId=" + this.productId + "&shopSupplierId=" + this.serviceUser.shopSupplierId + "&nickName=" + this.serviceUser.nickName);
				}
			}
		},
		/*关闭客服*/
		closeMpservice() {
			this.isMpservice = false;
		},
		changeSwiper() {
			this.isVideoPlay = false;
		},
		//收藏商品
		favorite() {
			let self = this;
			self._post("user/favorite/fav", {
				productId: self.productId
			}, res => {
				if (self.isFav) {
					self.isFav = false;
					uni.showToast({
						title: res.msg
					});
				} else {
					self.isFav = true;
					uni.showToast({
						title: res.msg
					});
				}
			});
		},
		returnValFunc(e) { },
		sendFunc(e) {
			this[e]();
		}
	}
};
</script>

<style lang="scss" scoped>
.top-scroll-nav {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	overflow: hidden;
	background: rgba(255, 255, 255, 1);
	z-index: 100;
	border-bottom: 1px solid #f2f2f2;

	.top-title {
		flex: 1;
		text-align: center;
		padding-right: 42rpx;
	}

	transition: background 0.3s;
}

.top-scroll-nav.close {
	background: rgba(255, 255, 255, 0);
	height: 0;
	padding: 0 !important;
}

.top-scroll-nav-item.active {
	position: relative;
}

.top-scroll-nav-item.active::after {
	content: "";
	position: absolute;
	bottom: -10rpx;
	width: 20%;
	height: 4rpx;
	border: 4rpx;
	left: 0;
	right: 0;
	margin: auto;
	@include background_color("background_color");
}

button {
	margin: 0;
	border: none;
}

button.active-btn::after {
	width: 0;
}

.product-detail {}

.sage-bottom {
	width: 100%;
	height: calc(100rpx + env(safe-area-inset-bottom));
}

.contentVideo,
.contentVideo image {
	width: 702rpx;
	height: 702rpx;
	position: relative;
}

.product-detail .product-pic,
.product-detail .product-pic .swiper,
.product-detail .product-pic image {
	width: 750rpx;
	height: 750rpx;
}

.contentVideo .icon.icon-bofang,
.product-detail .product-pic .swiper .icon-bofang {
	position: absolute;
	top: 0;
	bottom: 0;
	left: 0;
	right: 0;
	margin: auto;
	font-size: 48rpx;
	color: #ffffff;
	border-radius: 50%;
	border: 4rpx solid #ffffff;
	width: 120rpx;
	height: 120rpx;
	display: flex;
	justify-content: center;
	align-items: center;
	background-color: #00000080;
	padding-left: 16rpx;
	box-sizing: border-box;
	z-index: 10;
}

.product-detail .price-wrap {
	display: flex;
	justify-content: space-between;
	align-items: center;
}

.product-detail .price-wrap .left {
	display: flex;
	justify-content: flex-start;
	align-items: flex-end;
}

.product-detail .price-wrap .new-price {
	@include font_color("price_color");
	font-size: 30rpx;
	font-weight: bold;
	margin-right: 14rpx;
}

.fn {
	font-weight: normal;
}

.product-detail .price-wrap .new-price .num {
	padding: 0 4rpx;
	font-size: 40rpx;
}

.product-detail .price-wrap .old-price {
	font-size: 22rpx;
	color: #999999;
	font-weight: 400;
	text-decoration: line-through;
	margin-left: 10rpx;
}

.product-detail .already-sale {
	font-size: 24rpx;
	color: #999999;
}

.product-detail .product-name {
	padding-top: 26rpx;
	font-size: 30rpx;
	font-weight: 500;
	color: #333333;
}

.product-detail .product-describe {
	line-height: 38rpx;
	font-size: 24rpx;
	color: #666666;
	word-break: break-all;
	margin-top: 28rpx;
}

.already-choice {
	background: #ffffff;
}

.product-choice {
	margin-top: 20rpx;
	margin-left: 23rpx;
	margin-right: 25rpx;
	background: #ffffff;
	border-radius: 20rpx;
}

.product-comment,
.product-content {
	margin-top: 20rpx;
	margin-left: 23rpx;
	margin-right: 25rpx;
	background: #ffffff;
	border-radius: 20rpx;
}

.product-content .content-box p image {
	width: 100%;
}

.product-content .content-box {
	font-size: 36rpx;
}

.btns-wrap {
	position: fixed;
	height: 100rpx;
	right: 0;
	bottom: 0;
	left: 0;
	display: flex;
	background: #ffffff;
	align-items: center;
	padding-left: 5rpx;
	padding-bottom: env(safe-area-inset-bottom);
}

.btns-wrap .icon-box {
	width: 92rpx;
	height: 100rpx;
}

.btns-wrap .icon-box .iconfont {
	font-size: 40rpx;
	color: #999999;
}

.btns-wrap .icon-box .iconfont .num {
	position: absolute;
	top: 10rpx;
	left: 50%;
	height: 30rpx;
	min-width: 30rpx;
	overflow: hidden;
	line-height: 32rpx;
	border-radius: 15rpx;
	font-size: 20rpx;
	@include text_color("text_color1");
	@include background_color("background_color");
}

.btns-wrap button,
.btns-wrap button:after {
	height: 100rpx;
	line-height: 100rpx;
	margin: 0;
	padding: 0;
	flex: 1;
	border-radius: 0;
	border: 0;
}

.btns-wrap button.add-cart {
	font-size: 28rpx;
	width: 214rpx;
	height: 75rpx;
	line-height: 75rpx;
	border-top-left-radius: 40rpx;
	border-bottom-left-radius: 40rpx;
	margin-left: 17rpx;
	@include font_color("text_color2");
	@include background_linearmore("cart_left1",
		"cart_left2",
		"left_deg",
		0%,
		100%);
}

.btns-wrap button.add-cart-no {
	font-size: 28rpx;
	width: 214rpx;
	height: 75rpx;
	line-height: 75rpx;
	border-top-left-radius: 40rpx;
	border-bottom-left-radius: 40rpx;
	color: #ffffff;
	margin-left: 17rpx;
	background: #cccccc;
}

.btns-wrap button.buy {
	font-size: 28rpx;
	width: 214rpx;
	height: 75rpx;
	line-height: 75rpx;
	border-top-right-radius: 40rpx;
	border-bottom-right-radius: 40rpx;
	margin-right: 30rpx;
	@include font_color("text_color1");
	@include background_linearmore("cart_right1",
		"cart_right2",
		"right_deg",
		0%,
		100%);
}

.btns-wrap button.buy.ispresale {
	line-height: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
}

.shoucang-box {
	position: fixed;
	padding-right: 10rpx;
	width: 80rpx;
	height: 80rpx;
	right: 0;
	bottom: 270rpx;
	display: flex;
	justify-content: center;
	align-items: center;
	border-radius: 16rpx 0 0 16rpx;
	background: rgba(0, 0, 0, 0.8);
}

.shoucang-box button {
	padding: 0;
	background: 0;
	line-height: 60rpx;
}

.shoucang-box .iconfont {
	margin-bottom: 10rpx;
	font-size: 50rpx;
	color: #ffffff;
	position: relative;
	top: 5rpx;
}

.share-box {
	position: absolute;
	right: 0;
	bottom: -16rpx;
}

.share-box button {
	padding: 0;
	background: 0;
	line-height: 1;
	border-radius: 0;
	display: flex;
	justify-content: center;
	align-items: center;
	flex-direction: column;
}

.share-box .iconfont {
	margin-bottom: 10rpx;
	font-size: 50rpx;
	color: #ffffff;
}

.sc-box {
	position: absolute;
	right: 78rpx;
	bottom: -16rpx;
}

.sc-box button {
	padding: 0;
	background: 0;
	line-height: 1;
	border-radius: 0;
	display: flex;
	justify-content: center;
	align-items: center;
	flex-direction: column;
}

.sc-box .iconfont.icon {
	font-size: 38rpx;
}

.create-img {
	width: 100%;
	padding: 20rpx;
	box-sizing: border-box;
}

.create-img image {
	width: 100%;
}

.create-img button {
	width: 100%;
	height: 88rpx;
	line-height: 88rpx;
	border-radius: 44rpx;
}

.shop_head_info {
	// margin: 20rpx;
	padding: 30rpx;
	// box-sizing: border-box;
	// background-color: white;
	// border-radius: 12rpx;
}

.shop-box {
	width: 100%;
	height: 120rpx;
	display: flex;
	justify-content: space-between;
}

.shop-logo {
	width: 120rpx;
	height: 120rpx;
}

.shop-logo image {
	width: 100%;
	height: 100%;
	background-color: rgba(0, 0, 0, 0.1);
	border-radius: 12rpx;
}

.shop-box-info {
	box-sizing: border-box;
	margin-left: 20rpx;
	padding-top: 0;
	display: flex;
	justify-content: space-between;
	flex-direction: column;
}

.shop-infobox {
	box-sizing: border-box;
	display: flex;
	justify-content: space-between;
	flex-direction: column;
	text-align: right;
	padding-top: 0;
}

.shop-infobox button {
	width: 160rpx;
	height: 60rpx;
	border-radius: 30rpx;
	line-height: 60rpx;
	font-size: 26rpx;
	font-family: PingFang SC;
	font-weight: 500;
	border: 1rpx solid;
	text-align: center;
	padding: 0;
}

.store_type {
	display: inline-block;
	@include background_color("background_color");
	@include text_color("text_color1");
	border-radius: 7rpx;
	font-weight: 200;
	height: 35rpx;
	line-height: 35rpx;
	font-size: 21rpx;
	padding: 0 10rpx;
	margin-right: 20rpx;
}

.share_img {
	width: 42rpx;
	height: 42rpx;
	margin: 0 auto;
	margin-bottom: 4rpx;
}

.fn {
	font-weight: normal;
}

.share_img.img_gray {
	-webkit-filter: grayscale(100%);
	filter: grayscale(100%);
}

.share_text {
	line-height: 34rpx;
}

.reg180 {
	padding-right: 20rpx;
	text-align: center;
	transform: rotateY(180deg);
	display: flex;
	justify-content: flex-end;
	align-items: center;
}

.header {
	z-index: 99;
	position: fixed;
	height: 30px;
	line-height: 30px;
	top: 0;
	left: 0;
	width: 100%;
	padding-top: var(--status-bar-height);
}

.header .reg180 .icon-you {
	color: #ffffff;
	background: rgba($color: #000000, $alpha: 0.6);
	display: block;
	width: 44rpx;
	height: 44rpx;
	line-height: 44rpx;
	border-radius: 50%;
}

.btn_btom {
	height: 90rpx;
	line-height: 45rpx;
}

.btnname {
	position: absolute;
	bottom: -16px;
	left: 0;
	right: 0;
}

.icon-stores {
	color: #333333;
}

.icon-kefu2 {
	color: #333333;
}

.cart_num {
	position: absolute;
	width: 30rpx;
	height: 30rpx;
	display: flex;
	justify-content: center;
	align-items: center;
	font-size: 22rpx;
	border-radius: 50%;
	color: #ffff;
	right: 4rpx;
	top: 4rpx;
	@include background_color("background_color");
}

.video {
	width: 100%;
	height: 100%;
}

.scroll-box {
	// padding-bottom: env(safe-area-inset-bottom);
	box-sizing: border-box;
}

.coupon_item {
	height: 40rpx;
	line-height: 40rpx;
	border-radius: 6rpx;
	background-color: #fff2f1;
	// color: $dominant-color;
	@include font_color("font_color");
	padding: 0 16rpx;
	text-align: center;
	font-size: 22rpx;
	margin-left: 10rpx;
}

.group-hd {
	position: relative;
	padding-left: 0rpx;
	box-sizing: border-box;
	display: flex;
	justify-content: flex-start;
	align-items: center;
}

.text-box {
	padding: 6rpx 7rpx;
	@include font_color("font_color");
	@include background_color("opacify_background_0");
	margin-right: 10rpx;
	border-radius: 4rpx;
	font-size: 22rpx;
	// height: 32rpx;
	line-height: 1;
}

.text-box-coupon {
	width: 102rpx;
	font-size: 22rpx;
	height: 42rpx;
	border-radius: 42rpx;
	color: #ffff;
	display: flex;
	justify-content: center;
	align-items: center;
	@include background_color("background_color");
	color: #fff;

	.icon.icon-you {
		@include text_color("text_color1");
		border-radius: 50%;
		font-size: 14rpx;
		margin-left: 10rpx;
		// padding: 3rpx;
		width: 22rpx;
		height: 22rpx;
		display: flex;
		justify-content: center;
		align-items: center;
		font-weight: bold;
	}
}

.group-hd.d-b-s {
	height: auto;
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
}

.hide.group-hd::after {
	width: 0;
}

.group-hd .line-h-90 {
	line-height: 90rpx;
}

.group-hd .line-h-50 {
	line-height: 50rpx;
}

/* 预售 */
.product-detail .limited-spike {
	position: relative;
	z-index: 2;
	margin-top: -112rpx;
	padding: 0 35rpx;
	color: #ffffff;
	background: linear-gradient(140deg, #f11e0b 0%, #f77737 100%);
	border-radius: 15rpx;
	height: 278rpx;
	padding: 40rpx 21rpx;
	box-sizing: border-box;
}

.product-detail .limited-spike .left-name {
	font-size: 22rpx;
	color: #ffffff;
}

.product-detail .limited-spike .right-time {
	position: absolute;
	right: 20rpx;
	top: 58rpx;
}

.product-detail .limited-spike .right-time .jiantou {
	width: 20rpx;
	height: 20rpx;
	margin-left: 9rpx;
}

.mt-down-box {
	margin-top: -80rpx;
	z-index: 3;
	position: relative;
	border-radius: 20rpx;
}

.tips-box {
	margin-left: 8rpx;
	height: 40rpx;
	line-height: 40rpx;
	padding: 0 24rpx 0 14rpx;
	box-sizing: border-box;
	font-size: 20rpx;
	font-weight: 500;
	color: #ffffff;
	background-color: rgba($color: #ffffff, $alpha: 0.45);
	border-radius: 20rpx;
}

.product-detail .product-presale {
	padding: 26rpx;
	line-height: 40rpx;
	font-size: 26rpx;
	color: #666666;
	background-color: rgba($color: #31c19e, $alpha: 0.1);
	border-radius: 12rpx;
	word-break: break-all;
	margin-top: 28rpx;
}

.manjian-box {
	background: #ffe6e4;
	border-radius: 12rpx;
	font-size: 22rpx;
	padding: 6rpx 16rpx;
	font-family: Source Han Sans CN;
	font-weight: 400;
	@include font_color("font_color");
	margin-right: 8rpx;
}

.top-scroll-nav {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	overflow: hidden;
	background: rgba(255, 255, 255, 1);
	z-index: 100;
	border-bottom: 1px solid #f2f2f2;

	.top-title {
		flex: 1;
		text-align: center;
		padding-right: 42rpx;
	}

	transition: background 0.3s;
}

.top-scroll-nav.close {
	background: rgba(255, 255, 255, 0);
	height: 0;
	padding: 0 !important;
}

.top-scroll-nav-item.active {
	position: relative;
}

.top-scroll-nav-item.active::after {
	content: "";
	position: absolute;
	bottom: -10rpx;
	width: 20%;
	height: 4rpx;
	border: 4rpx;
	left: 0;
	right: 0;
	margin: auto;
	@include background_color("background_color");
}

.product-info {
	background: #ffffff;
	border-radius: 20rpx;
	margin: 0 25rpx 0 23rpx;
	margin-top: 20rpx;
}
</style>
